From: kaf24@firebug.cl.cam.ac.uk Date: Wed, 5 Oct 2005 15:54:09 +0000 (+0100) Subject: Emulate guest reads of CR4, masking features that Xen X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16763^2~34 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=e127ae595201d5aa07240b0ad45ac15ef9fead08;p=xen.git Emulate guest reads of CR4, masking features that Xen does not export to guests. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index e0f00d3920..44f902f505 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -895,6 +895,14 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) *reg = pagetable_get_paddr(v->arch.guest_table); break; + case 4: /* Read CR4 */ + /* + * Guests can read CR4 to see what features Xen has enabled. We + * therefore lie about PGE & PSE as they are unavailable to guests. + */ + *reg = read_cr4() & ~(X86_CR4_PGE|X86_CR4_PSE); + break; + default: goto fail; }